From: Roger Pau Monne Date: Thu, 31 Mar 2016 12:56:36 +0000 (+0200) Subject: hotplug/FreeBSD: add block hotplug script X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~1364 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=a989f03607085a632f4247de2033b29ade8591db;p=xen.git hotplug/FreeBSD: add block hotplug script This is the default hotplug script for block devices. Its only job is to copy the "params" blkback xenstore node to "physical-device". Signed-off-by: Roger Pau Monné Acked-by: Wei Liu --- diff --git a/tools/hotplug/FreeBSD/Makefile b/tools/hotplug/FreeBSD/Makefile index 10fce4fb7a..bd7a86fa07 100644 --- a/tools/hotplug/FreeBSD/Makefile +++ b/tools/hotplug/FreeBSD/Makefile @@ -2,7 +2,7 @@ XEN_ROOT = $(CURDIR)/../../.. include $(XEN_ROOT)/tools/Rules.mk # Xen script dir and scripts to go there. -XEN_SCRIPTS = vif-bridge +XEN_SCRIPTS = vif-bridge block XEN_SCRIPT_DATA = diff --git a/tools/hotplug/FreeBSD/block b/tools/hotplug/FreeBSD/block new file mode 100644 index 0000000000..a31cca45cb --- /dev/null +++ b/tools/hotplug/FreeBSD/block @@ -0,0 +1,25 @@ +#!/bin/sh -e +# +# FreeBSD hotplug script for attaching disks +# +# Parameters: +# $1: xenstore backend path of the vbd +# $2: action, either "add" or "remove" +# +# Environment variables: +# None +# + +path=$1 +action=$2 +params=$(xenstore-read "$path/params") + +case $action in +add) + xenstore-write $path/physical-device-path $params + exit 0 + ;; +*) + exit 0 + ;; +esac